<!DOCTYPE HTML>
<html>
<head>
<title>SplashTextOn / SplashTextOff | AutoHotkey</title>
<meta name="description" content="The SplashTextOn and SplashTextOff commands create or remove a customizable text popup window." />
<meta name="ahk:equiv-v2" content="objects/Gui.htm" />
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="../static/theme.css" rel="stylesheet" type="text/css" />
<script src="../static/content.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script>
</head>
<body>

<h1>SplashTextOn / SplashTextOff</h1>

<p>创建自定义文本的弹出窗口.</p>

<pre class="Syntax">
<span class="func">SplashTextOff</span>
<span class="func">SplashTextOn</span> <span class="optional">, Width, Height, Title, Text</span>
</pre>
<h2>参数</h2>
<dl>

  <dt>Width</dt>
  <dd><p>以像素为单位的窗口宽度. Default 200. 此参数可以为<a href="../Variables.htm#Expressions">表达式</a>.</p></dd>

  <dt>Height</dt>
  <dd><p>窗口(不包括标题栏) 的高度, 单位为像素. 默认为 0(即只显示标题栏). 此参数可以为<a href="../Variables.htm#Expressions">表达式</a>.</p></dd>

  <dt>标题</dt>
  <dd><p>窗口标题. 默认为空.</p></dd>

  <dt>文本</dt>
  <dd><p>窗口的文本. 默认为空. 如果 <em>Text</em> 较长, 可以通过<a href="../Scripts.htm#continuation">延续片段</a>的方法将其分解成较短的几行, 这样可以增加可读性和可维护性.</p></dd>

</dl>
<h2>备注</h2>
<p>要对布局和字体名称/颜色/大小进行更多的控制, 请使用带 <code>zh0</code> 选项的 <a href="Progress.htm">Progress</a> 命令, 它不显示标题栏而只显示文本. 例如: <code>Progress, zh0 fs18, Some 18-point text to display</code>.</p>
<p>使用 SplashTextOff 命令来移除现有的弹出窗口.</p>
<p>弹出窗口是 "置顶的", 意味着它总是保持在其他所有普通窗口的上面. 要改变这种状态, 请使用 <code><a href="WinSet.htm">WinSet</a>, AlwaysOnTop, Off, &lt;insert title of splash window&gt;</code>. <a href="WinSet.htm">WinSet</a> 还可以让弹出窗口透明.</p>
<p><a href="WinMove.htm">WinMove</a> 可以用来对此命令显示的 SplashText 窗口进行移动和调整大小.</p>
<p>与 <a href="Progress.htm">Progress</a>, <a href="Progress.htm">SplashImage</a>, <a href="MsgBox.htm">MsgBox</a>, <a href="InputBox.htm">InputBox</a>, <a href="FileSelectFile.htm">FileSelectFile</a> 以及 <a href="FileSelectFolder.htm">FileSelectFolder</a> 不同, 每个脚本只能显示一个 SplashText 窗口.</p>
<p>如果在已经显示弹出窗口时使用 SplashTextOn, 则使用新的参数值重新创建窗口. 然而, 当您想改变弹出窗口的标题或文本时与其重新创建弹出窗口, 不如使用下列方法来获得更好的性能, 尤其在需要频繁改变窗口时:</p>
<pre><a href="WinSetTitle.htm">WinSetTitle</a>, &lt;insert title of splash window&gt;, , NewTitle
<a href="ControlSetText.htm">ControlSetText</a>, Static1, NewText, &lt;insert title of splash window&gt;</pre>
<h2>相关</h2>
<p><a href="Progress.htm">Progress</a>, <a href="Progress.htm">SplashImage</a>, <a href="ToolTip.htm">ToolTip</a>, <a href="MsgBox.htm">MsgBox</a>, <a href="InputBox.htm">InputBox</a>, <a href="FileSelectFile.htm">FileSelectFile</a>, <a href="FileSelectFolder.htm">FileSelectFolder</a>, <a href="WinMove.htm">WinMove</a>, <a href="WinSet.htm">WinSet</a></p>
<h2>示例</h2>
<div class="ex" id="ExBasic">
<p><a href="#ExBasic">#1</a></p>
<pre>SplashTextOn, , , Displays only a title bar.
Sleep, 2000
SplashTextOn, 400, 300, Clipboard, The clipboard contains:`n%clipboard%
WinMove, Clipboard, , 0, 0  <em>; 把弹出窗口移动到左上角.</em>
MsgBox, Press OK to dismiss the SplashText
SplashTextOff</pre>
</div>

</body>
</html>